import DelButton from '../../../components/delbutton';
import { IData } from '../../api/project/content/query.api';
import api from '../../../atoms/api';
import Edit from './edit';
import Table from '../../../components/table';

export default function List({ data, team }: {
	data: IData[];
	team: ITbteam;
}) {
	return <>
		<Table
			idfieldname='project_id'
			data={data}
			render={(record) => {
				const { project_id, ...data } = record;
				const id = record.project_id;
				const url = `/teamglz/project?id=${id}`;
				return <div className='op' key={id}>
					{/* <Edit data={data}/> */}
					<a href={url}>团队管理</a>
					<DelButton query={{
						id
					}} dlgtitle='确认删除' api={api['/api/project/del']} />
				</div>;
			}}
		>
			<Table.Column<IData> title='年级' key='grade' dataIndex='grade' align='left' />
			<Table.Column<IData> title='班级名称' key='classname' dataIndex='classname' align='left' />
			<Table.Column<IData> title='团队名称' key='teamname' dataIndex='teamname' align='left' />
			<Table.Column<IData> title='项目名称' key='projectname' dataIndex='projectname' align='left' />
		</Table>
	</>;
}
